﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace HdipCricketClub.Models
{
    public class OpponentRepository
    {
        CricketClubEntities db = new CricketClubEntities();

        public Opponent GetOpponent(int id)
        {
            return db.Opponents.Single(o => o.opponent_id == id);
        }


        public IQueryable<Opponent> FindAllOpponents()
        {
            return db.Opponents.Include("County1").OrderBy(o => o.club_name).ThenBy(o => o.team_name);
        }
    }
}